package com.wzy.controller;



import com.wzy.product.bean.Product;
import com.wzy.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {


    @Autowired
    ProductService productService;

//    查询商品
    @GetMapping("/product/{id}")
    public Product getProduct(@PathVariable("id") Long productID){
        System.out.println("--------访问了");
        Product product = productService.getProductById(productID);
        return product;
    }



}

